Interested in scp recipe for sftp [closed]

Posted by GJZ on Server Fault See other posts from Server Fault or by GJZ
Published on 2012-11-13T21:34:15Z Indexed on 2012/11/13 23:04 UTC
Read the original article Hit count: 220

Filed under:

You wrote in a reply this

Blockquote The problem is that sftp runs as the user's id -- first, the sftp client ssh's into the target host as the given user, then runs sftp-server. Since sftp-server is running as a regular user, it has no way to "give away" a file (change owner of a file).

However, if you are able to use scp, and assign a key pair to each user, you can get around this. This involves adding a user's key to root's ~/.ssh/authorized_keys file, with a "command=" parameter to force it to run a script that sanitizes and alters the arguments of the server-side scp program. I've used this technique before to set up an anonymous scp dropbox that allowed anyone to submit a file, and ensure that no one could retrieve submitted files and also prevent overwrites.

If you are open to this technique, let me know and I'll update this post with a quick recipe.

We are interested in this scp quick recipe for our community services file sharing.

Best Regards, Gert Jan Zeilstra

© Server Fault or respective owner

Related posts about linux